#include <header.h>

int main(){

    // 打开目录流
    DIR *dir = opendir("/home/snow/code/2th/Day06");
    // dir指向这个目中记录的其中第一个目录项


    // 循环读取目录项
    while(1){
        
        struct dirent *pDirent = readdir(dir);
        if(pDirent == NULL){
            break;
        }

    
        if(pDirent->d_type == DT_DIR){
            char *newName = pDirent->d_name;
            
            char newPath[200] = {0};
            sprintf(newPath, "%s/%s", "/home/snow/code/2th/Day06", newName);

            printf("文件夹: 新路径: %s \n", newPath);

        }
        
        printf("%ld , %s \n",pDirent->d_off, pDirent->d_name);

    }




    closedir(dir);
    return 0;
}

